package ModelLayer;

import java.util.ArrayList;

public class Customer
{
	private int customerID;
	private String name;
	private String address;
	private String zipCode;
	private String phoneNr;
	private boolean customerGroup;
	private ArrayList<SalesOrder> salesorders;
	
	public Customer()
	{
		
	}
	public Customer(int customerID)
	{
		this.customerID = customerID;
	}
	public Customer(String name, String address, String zipCode, String phoneNr, boolean customerGroup)
	{
		this.name = name;
		this.address = address;
		this.zipCode = zipCode;
		this.phoneNr = phoneNr;
		this.customerGroup = customerGroup;
		salesorders = new ArrayList<SalesOrder>();
	}
	
	public void setName(String newName)
	{
		name = newName;
	}
	public void setAddress(String newAddress)
	{
		address = newAddress;
	}
	public void setZipCode(String newZipCode)
	{
		zipCode = newZipCode;
	}
	public void setPhoneNr(String newPhoneNr)
	{
		phoneNr = newPhoneNr;
	}
	public void setCustomerGroup(boolean newCustomerGroup)
	{
		customerGroup = newCustomerGroup;
	}
	public String getName()
	{
		return name; 	
	}
	public String getAddress()
	{
		return address; 	
	}
	public String getZipCode()
	{
		return zipCode; 	
	}
	public String getPhoneNr()
	{
		return phoneNr; 	
	}
	public boolean getCustomerGroup()
	{
		return customerGroup; 	
	}
	public int getCustomerID()
	{
		return customerID;
	}
	
	public void addSaleOrder(SalesOrder salesOrder)
    {
    	this.salesorders.add(salesOrder);
    }
    public SalesOrder getSaleOrder(int salesorder)
    {
    	if (salesorders.size() <= salesorder)
    	{
    		return salesorders.get(salesorder);
    	}
    	else
    	{
    		return null;
    	}
    }
}
